package org.swim.remote.manager;

import java.util.List;

import javax.ejb.Remote;
import javax.naming.NamingException;

import net.sf.json.JSONObject;

import org.swim.remote.entities.IAbility;
import org.swim.remote.entities.IUser;
import org.swim.remote.exceptions.AbilityException;
import org.swim.remote.exceptions.SwimException;
import org.swim.remote.exceptions.TokenException;

@Remote
public interface AbilityManagerRemote extends SwimEntityManager<IAbility>{

	 /**
	  * {
	  * 	token: "..."
	  * 	ability: {name:"..."}
	  * } 
	  * @param object
	  * @return
	  * @throws TokenException
	  * @throws AbilityException
	  * @throws NamingException
	 * @throws SwimException 
	  */
	public abstract IUser addNewAbility(JSONObject object) throws AbilityException, TokenException, NamingException, SwimException;
	 
	/** 
	 * {
	 * 	administratorToken: "..."
	 * 	abilityId: "..."
	 *  status: "CONFIRMED" or "REJECTED"
	 * }
	 * @param object
	 * @return
	 * @throws TokenException 
	 * @throws AbilityException 
	 */
	public abstract IAbility setStatusAbility(JSONObject object) throws TokenException, AbilityException;
	
	/** 
	 * {
	 * 	administratorToken: "..."
	 * }
	 * @param object
	 * @return
	 * @throws TokenException 
	 */
	public List<IAbility> findRequestedAbility(JSONObject object) throws TokenException;
	
	/**
	 * {
	 * 	search-query: {name:"..."}
	 * }
	 * @param object
	 * @return
	 */
	public abstract List<IAbility> findAbilities(JSONObject object);
	
	/**
	  * {
	  * 	token: "..."
	  * 	ability: {name:"..."}
	  * } 
	  * @param object
	  * @return
	  * @throws TokenException
	  * @throws AbilityException
	  * @throws NamingException
	 * @throws SwimException 
	  */
	public abstract IAbility administratorAddAbility(JSONObject object) throws AbilityException, TokenException;
	
}
